package com.lingshu.app.model.structure;

import androidx.databinding.Bindable;

import com.lingshu.app.BR;

/**
 * 乳腺结构化数据
 */
public class BreastStructureData extends StructureData {
    private Integer exceptionalBreastR = 0;
    private Integer exceptionalBreastL = 0;
    private Double widthBreastR = 0D;
    private Double widthBreastL = 0D;
    private Double heightBreastR = 0D;
    private Double heightBreastL = 0D;
    private Integer typeBreastR;
    private Integer typeBreastL;
    private Integer locationBreastR;
    private Integer locationBreastL;
    private Integer echoesBreastR;
    private Integer echoesBreastL;
    private Integer cysticSolidBreastR;
    private Integer cysticSolidBreastL;
    private Integer boundaryBreastR;
    private Integer boundaryBreastL;
    private Integer calcificationBreastR;
    private Integer calcificationBreastL;
    private Integer aspectBreastR;
    private Integer aspectBreastL;
    private Integer levelBreastR;
    private Integer levelBreastL;
    private Boolean enableBreastR = false;
    private Boolean enableBreastL = false;

    @Bindable
    public Integer getExceptionalBreastR() {
        return exceptionalBreastR;
    }

    public void setExceptionalBreastR(Integer exceptionalBreastR) {
        this.exceptionalBreastR = exceptionalBreastR;
        updateOtherProperty(true);
        notifyPropertyChanged(BR.enableBreastR);
        notifyPropertyChanged(BR.typeBreastR);
        notifyPropertyChanged(BR.widthBreastR);
        notifyPropertyChanged(BR.heightBreastR);
        notifyPropertyChanged(BR.locationBreastR);
        notifyPropertyChanged(BR.echoesBreastR);
        notifyPropertyChanged(BR.cysticSolidBreastR);
        notifyPropertyChanged(BR.boundaryBreastR);
        notifyPropertyChanged(BR.calcificationBreastR);
        notifyPropertyChanged(BR.aspectBreastR);
        notifyPropertyChanged(BR.levelBreastR);
    }

    @Bindable
    public Integer getExceptionalBreastL() {
        return exceptionalBreastL;
    }

    public void setExceptionalBreastL(Integer exceptionalBreastL) {
        this.exceptionalBreastL = exceptionalBreastL;
        updateOtherProperty(false);
        notifyPropertyChanged(BR.enableBreastL);
        notifyPropertyChanged(BR.typeBreastL);
        notifyPropertyChanged(BR.widthBreastL);
        notifyPropertyChanged(BR.heightBreastL);
        notifyPropertyChanged(BR.locationBreastL);
        notifyPropertyChanged(BR.echoesBreastL);
        notifyPropertyChanged(BR.cysticSolidBreastL);
        notifyPropertyChanged(BR.boundaryBreastL);
        notifyPropertyChanged(BR.calcificationBreastL);
        notifyPropertyChanged(BR.aspectBreastL);
        notifyPropertyChanged(BR.levelBreastL);
    }

    @Bindable
    public Double getWidthBreastR() {
        return widthBreastR;
    }

    public void setWidthBreastR(Double widthBreastR) {
        this.widthBreastR = widthBreastR;
    }

    @Bindable
    public Double getWidthBreastL() {
        return widthBreastL;
    }

    public void setWidthBreastL(Double widthBreastL) {
        this.widthBreastL = widthBreastL;
    }

    @Bindable
    public Double getHeightBreastR() {
        return heightBreastR;
    }

    public void setHeightBreastR(Double heightBreastR) {
        this.heightBreastR = heightBreastR;
    }

    @Bindable
    public Double getHeightBreastL() {
        return heightBreastL;
    }

    public void setHeightBreastL(Double heightBreastL) {
        this.heightBreastL = heightBreastL;
    }

    @Bindable
    public Integer getTypeBreastR() {
        return typeBreastR;
    }

    public void setTypeBreastR(Integer typeBreastR) {
        this.typeBreastR = typeBreastR;
    }

    @Bindable
    public Integer getTypeBreastL() {
        return typeBreastL;
    }

    public void setTypeBreastL(Integer typeBreastL) {
        this.typeBreastL = typeBreastL;
    }

    @Bindable
    public Integer getLocationBreastR() {
        return locationBreastR;
    }

    public void setLocationBreastR(Integer locationBreastR) {
        this.locationBreastR = locationBreastR;
    }

    @Bindable
    public Integer getLocationBreastL() {
        return locationBreastL;
    }

    public void setLocationBreastL(Integer locationBreastL) {
        this.locationBreastL = locationBreastL;
    }

    @Bindable
    public Integer getEchoesBreastR() {
        return echoesBreastR;
    }

    public void setEchoesBreastR(Integer echoesBreastR) {
        this.echoesBreastR = echoesBreastR;
    }

    @Bindable
    public Integer getEchoesBreastL() {
        return echoesBreastL;
    }

    public void setEchoesBreastL(Integer echoesBreastL) {
        this.echoesBreastL = echoesBreastL;
    }

    @Bindable
    public Integer getCysticSolidBreastR() {
        return cysticSolidBreastR;
    }

    public void setCysticSolidBreastR(Integer cysticSolidBreastR) {
        this.cysticSolidBreastR = cysticSolidBreastR;
    }

    @Bindable
    public Integer getCysticSolidBreastL() {
        return cysticSolidBreastL;
    }

    public void setCysticSolidBreastL(Integer cysticSolidBreastL) {
        this.cysticSolidBreastL = cysticSolidBreastL;
    }

    @Bindable
    public Integer getBoundaryBreastR() {
        return boundaryBreastR;
    }

    public void setBoundaryBreastR(Integer boundaryBreastR) {
        this.boundaryBreastR = boundaryBreastR;
    }

    @Bindable
    public Integer getBoundaryBreastL() {
        return boundaryBreastL;
    }

    public void setBoundaryBreastL(Integer boundaryBreastL) {
        this.boundaryBreastL = boundaryBreastL;
    }

    @Bindable
    public Integer getCalcificationBreastR() {
        return calcificationBreastR;
    }

    public void setCalcificationBreastR(Integer calcificationBreastR) {
        this.calcificationBreastR = calcificationBreastR;
    }

    @Bindable
    public Integer getCalcificationBreastL() {
        return calcificationBreastL;
    }

    public void setCalcificationBreastL(Integer calcificationBreastL) {
        this.calcificationBreastL = calcificationBreastL;
    }

    @Bindable
    public Integer getAspectBreastR() {
        return aspectBreastR;
    }

    public void setAspectBreastR(Integer aspectBreastR) {
        this.aspectBreastR = aspectBreastR;
    }

    @Bindable
    public Integer getAspectBreastL() {
        return aspectBreastL;
    }

    public void setAspectBreastL(Integer aspectBreastL) {
        this.aspectBreastL = aspectBreastL;
    }

    @Bindable
    public Integer getLevelBreastR() {
        return levelBreastR;
    }

    public void setLevelBreastR(Integer levelBreastR) {
        this.levelBreastR = levelBreastR;
    }

    @Bindable
    public Integer getLevelBreastL() {
        return levelBreastL;
    }

    public void setLevelBreastL(Integer levelBreastL) {
        this.levelBreastL = levelBreastL;
    }

    @Bindable
    public Boolean getEnableBreastR() {
        return enableBreastR;
    }

    public void setEnableBreastR(Boolean enableBreastR) {
        this.enableBreastR = enableBreastR;
    }

    @Bindable
    public Boolean getEnableBreastL() {
        return enableBreastL;
    }

    public void setEnableBreastL(Boolean enableBreastL) {
        this.enableBreastL = enableBreastL;
    }

    private void updateOtherProperty(boolean isRight) {
        if (isRight) {
            //右侧
            if (getExceptionalBreastR() < 2) {
                setEnableBreastR(false);
                setWidthBreastR(0D);
                setHeightBreastR(0D);
                setTypeBreastR(0);                      //数量
                setLocationBreastR(0);                  //位置
                setEchoesBreastR(0);                    //回声
                setCysticSolidBreastR(0);               //性质
                setBoundaryBreastR(0);                  //边缘
                setCalcificationBreastR(0);             //钙化
                setAspectBreastR(0);                    //纵横比
                setLevelBreastR(0);                     //分类
            } else {
                setEnableBreastR(true);
                setWidthBreastR(1D);
                setHeightBreastR(1D);
                setTypeBreastR(1);                      //数量
                setLocationBreastR(1);                  //位置
                setEchoesBreastR(1);                    //回声
                setCysticSolidBreastR(1);               //性质
                setBoundaryBreastR(1);                  //边缘
                setCalcificationBreastR(1);             //钙化
                setAspectBreastR(1);                    //纵横比
                setLevelBreastR(1);                     //分类
            }
        } else {
            //左侧
            if (getExceptionalBreastL() < 2) {
                setEnableBreastL(false);
                setWidthBreastL(0D);
                setHeightBreastL(0D);
                setTypeBreastL(0);                      //数量
                setLocationBreastL(0);                  //位置
                setEchoesBreastL(0);                    //回声
                setCysticSolidBreastL(0);               //性质
                setBoundaryBreastL(0);                  //边缘
                setCalcificationBreastL(0);             //钙化
                setAspectBreastL(0);                    //纵横比
                setLevelBreastL(0);                     //分类
            } else {
                setEnableBreastL(true);
                setWidthBreastL(1D);
                setHeightBreastL(1D);
                setTypeBreastL(1);                      //数量
                setLocationBreastL(1);                  //位置
                setEchoesBreastL(1);                    //回声
                setCysticSolidBreastL(1);               //性质
                setBoundaryBreastL(1);                  //边缘
                setCalcificationBreastL(1);             //钙化
                setAspectBreastL(1);                    //纵横比
                setLevelBreastL(1);                     //分类
            }
        }
    }
}
